package com.scala.oop.classDemo

/**
 * Created by Administrator on 2018/1/27/027.
 */
class HelloWorld {
  private var name = "leo"
  var age = 12
  val sex = 1
  def sayHello(): Unit = {
    println("Hello," + name)
  }
  def getName = name






  private var myName = "leo"
  def updataName(newName:String): Unit ={
    if(newName == "leo1")
      myName = newName
    else
      println("not accept this new name,"+newName)
  }



}
